package com.youlu.campus.entity;

import com.youlu.campus.base.base.EntityBase;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * 活动答案信息表
 */
@Getter
@Setter
@Document(collection = "activity_answer_info")
public class ActivityAnswerInfo extends EntityBase {
    private String activityId;
    private String activityQuestionId;
    private String title;
    /**
     * 是否是答案
     */
    private Boolean answered = Boolean.FALSE;
    private String imageUrl;
    /**
     * 优先级
     */
    private Integer priority=1;
    /**
     * 是否选择
     */
    private Boolean choiced = Boolean.FALSE;

    /**
     * 答题分析
     */
    private String qaAnalysis;

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;

        if (o == null || getClass() != o.getClass()) return false;

        ActivityAnswerInfo that = (ActivityAnswerInfo) o;

        return new EqualsBuilder()
                .append(getId(), that.getId())
                .append(answered, that.answered)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(this.getId())
                .append(answered)
                .toHashCode();
    }
}
